/* 翻译页面样式 */
.translation-content {
    max-width: 1000px;
    margin: 0 auto;
}

.translation-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.translation-box {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.translation-title {
    font-size: 18px;
    font-weight: 600;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--bg-primary);
}

.swap-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.swap-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.translation-textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 20px;
}

.translation-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.character-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.translation-result {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-title {
    font-size: 16px;
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.result-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.llm-badge {
    display: inline-block;
    background-color: #4d94ff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
}

.translation-content {
    margin-top: 5px;
}

.llm-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #dc3545;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
}

.contextual-translation {
    margin-top: 40px;
}

.contextual-translation h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.context-input {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.context-input label {
    font-size: 16px;
    font-weight: 500;
}

.context-input textarea {
    height: 100px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
}

.contextual-result {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

.contextual-result h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.translation-types {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.translation-type {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.translation-type:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.translation-type h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.translation-type p {
    font-size: 16px;
    line-height: 1.6;
}

.alternatives {
    margin-top: 15px;
}

.alternatives h5 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.alternative-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.alternative-item {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
}

.cultural-notes {
    margin-top: 15px;
    padding: 15px;
    background-color: #FFF8E6;
    border-left: 3px solid var(--warning);
    border-radius: 4px;
}

.cultural-notes h5 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #B7791F;
}

.history-section {
    margin-top: 40px;
}

.history-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background-color: #EDF2F7;
}

.history-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.original-text {
    font-weight: 500;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.language-pair {
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-date {
    font-style: italic;
}

@media (max-width: 768px) {
    .translation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .translation-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .character-count {
        margin-top: 10px;
    }
}